# appointed libs and their dir
LOCAL_SHARED_LIB:= akuio akispsdk akstreamenc
PLAT_STATIC_LIB:= plat_vi plat_common plat_thread plat_vpss
MPI_STATIC_LIB:= mpi_venc mpi_md

LIBS := $(addprefix $(PLAT_LIB_DIR)/,$(patsubst %,lib%.a,$(PLAT_STATIC_LIB)))
LIBS += $(addprefix $(MPI_LIB_DIR)/,$(patsubst %,lib%.a,$(MPI_STATIC_LIB)))

LDFLAGS := $(LOCAL_LDFLAGS)
LDFLAGS += $(addprefix -l,$(patsubst lib%,%,$(LOCAL_SHARED_LIB)))
LDFLAGS += $(STD_LDFLAGS)

SRCS := $(wildcard *.c)
OBJS := $(patsubst %.c,%.o,$(SRCS))
TARGET := ak_hw_md_demo

all:$(TARGET)
	
$(TARGET):$(OBJS)
	$(LD) $^ $(LDFLAGS) -Xlinker "-(" $(LIBS) -Xlinker "-)" -o $@
	$(STRIP) $@
	
%.o : %.c
	$(CC) $(CFLAGS) -c $^ -o $@
	@echo "" 

install:
	$(CP) $(TARGET) $(ROOTFS_BIN_DIR) 
	@echo "" 

clean:
	$(RM) *.o
	$(RM) $(TARGET)

.PHONY: all clean install
